﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace SquidConsult.Controls
{
  public partial class RolesForUser : System.Web.UI.UserControl
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      MembershipUser currentUser = Membership.GetUser();
      if (currentUser != null)
      {
        string[] roles = Roles.GetRolesForUser(currentUser.UserName);

        ltrRoleName.Text = "Role(s) you are granted:<br/>";

        foreach (string role in roles)
        {
          ltrRoleName.Text += string.Format("{0}<br/>", role);
        }
      }
    }
  }
}